var t = getApp();

Page({
    data: {
        action: "",
        nextAction: "",
        datas: [],
        title: "排行榜"
    },
    onLoad: function(a) {
        a.action && this.setData({
            action: a.action
        }), t._isTextEmpty(a.title) || this.setData({
            title: a.title
        }), this._getData();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    _getData: function() {
        var a = this, n = t.getNetAddresss("plugin.ranking.api.ranking.get-ranking-list");
        n += "&ranking_list_class=" + this.data.action, t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 == n.result && a.setData({
                    datas: n.data.data,
                    nextAction: n.data.ranking_info_class
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    gorankingListFirst: function(t) {
        var a = t.currentTarget.dataset.index;
        wx.navigateTo({
            url: "/packageB/member/ranking/rankingListFirst/rankingListFirst?action=" + this.data.nextAction + "&title=" + this.data.title + "&key=" + this.data.datas[a].key
        });
    }
});